{% extends 'base.html.twig' %}
{% import 'Import/app_import.html.twig' as appImport %}

{% block head_title %}{{ 'nodes'|trans }} - {{ node.name }} - {{ 'plugins'|trans }}{% endblock %}

{% block heading_1 %}
    {{ appImport.heading({'level': 1, 'title': 'nodes'|trans, 'link': {'url': path('nodes')}}) }}
{% endblock %}

{% block heading_2 %}
    {% if master_node == node.name %}
        {{ appImport.heading({'level': 2, 'title': node.name, 'badge': {'title': 'master'|trans, 'context': 'master_node'}}) }}
    {% else %}
        {{ appImport.heading({'level': 2, 'title': node.name}) }}
    {% endif %}
{% endblock %}

{% block tabs %}
    {% include 'Modules/node/node_read_tabs.html.twig' with {'active': 'plugins'} %}
{% endblock %}

{% block main_content %}
    {% embed 'Embed/block_embed.html.twig' %}
        {% import 'Import/app_import.html.twig' as appImport %}
        {% block content %}
            {{ appImport.heading({'level': 3, 'title': 'plugins'|trans, 'badge': {'title': node.plugins|length}}) }}

            {% if 0 < node.plugins|length %}
                {% embed 'Embed/table_embed.html.twig' %}
                    {% block thead %}
                        <tr>
                            <th>{{ 'name'|trans }}</th>
                            <th>{{ 'description'|trans }}</th>
                            <th class="d-none d-xl-table-cell">{{ 'classname'|trans }}</th>
                            <th>{{ 'version'|trans }}</th>
                        </tr>
                    {% endblock %}

                    {% block tbody %}
                        {% for row in node.plugins %}
                            <tr>
                                <td>{{ row['name'] }}</td>
                                <td>{{ row['description'] }}</td>
                                <td class="d-none d-xl-table-cell">{{ row['classname'] }}</td>
                                <td>{{ row['version'] }}</td>
                            </tr>
                        {% endfor %}
                    {% endblock %}
                {% endembed %}
            {% endif %}
        {% endblock %}
    {% endembed %}
{% endblock %}
